Iranians are nice people but their foreign policy seems to be more like a cry for attention from America rather than true hostility toward America. It's a bit like North Korea.
This is a misconception, my friend.
Firstly, as the previous poster above me reminded, Iran and the US have had an excessively furnished history of direct and indirect mutual confrontation ever since the 1979 Islamic Revolution which overthrew the shah of Iran, an American vassal ruler.
Iran and the US traded military strikes against one another in Lebanon (bombing of the US Marine barracks that killed 241 American servicemen in a single operation), in the waters of the Persian Gulf (the US regime's Praying Mantis operation in support of Saddam Hussein's war effort), in Iraq from the illegal US invasion in 2003 up to this very day. Prior to this, the former US embassy, considered a spy den, was taken over by Iranian students, after which Washington sent special forces to try and free the "embassy" personnel detained in Tehran but the operation failed thanks to an unexpected sand storm that ended up causing an accident and killing involved US troops.
The economic, diplomatic, intelligence and cultural war waged by the US and its allies on Iran is unprecedented in human history. For instance, on "social media" sites such as Twitter or Instagram, the volume of daily news items and posts published by the BBC's Persian-language service, equals something like ten times the amount of posts from the second most prolific foreign language service of the same BBC!
In order to understand the reasons behind Iran's policy towards the US during the Obama years, in particular with the nuclear deal (JCPoA) and Tehran's apparent engagement on a path of negotiation with a view to reducing tensions, you need to fully grasp the inherent characteristics of Iran's system of governance. Like China, Iran hosts a complex polity built upon a several millenia-old imperial basis. However, Iran's political system is properly pluralistic, dual to be precise - much more so than liberal, so-called democracies of the west. While in the west, the deep state, private interest groups as well as international oligarchic networks determine fundamental policy orientations, orientations which rival political formations systematically and wholeheartedly adhere to, in Iran the two political camps are diametrically opposed in their political outlooks as they strive for completely opposite, irreconcilable long term objectives including on the geopolitical front.
The first camp, which we shall call revolutionary, remains loyal to the anti-imperial and revolutionary principles of 1979 rooted in Islamic Iranian civilization: it advocates continued challenging of the zio-American dominated oppressive world order as well as preservation of religious integrity, upholding of national sovereignty, shielding of tradition from technical and scientific evolution, a maximum degree of independence for Iran as well as social justice at the global scale, in line with the tradition of the Imams of Shia Islam and as a way to prepare the ground for the return of the Islamc saviour, the Mahdi.
The second camp can be termed liberal. It consists of an alliance between two major political currents, the so-called centrists and reformists. This camp's political project represents a complete departure from the aforementioned principles and values of the 1979 Revolution. In that sense, it is a revisionist political force that broke with the ideological foundations of the political system in whose framework it operates and which it seeks to subvert from within, shaving and reforming it until it is no longer recognizable. This is the process which hostile foreign powers, to which the liberal Iranian camp serves as a de facto infiltrated fifth column, are referring to as the "normalization of Iran" which they wish to see implemented. We could add that the liberal segment of the Iranian establishment, which surfaced sometime in the late 1980's as a result of domestic shifts and a redefinition of political visions among certain currents within the system, is adopting a thoroughly defeatist, subservient attitude not just towards the US and zionist regimes but also towards international organizations as well as the financial and corporate networks of the global oligarchy. It is perfectly poised to embrace the interference of these foreign powers into Iran's internal affairs and to execute the predefined agendas they impose on nations. Its leading intellectuals and political strategists are content with aping western-inspired secularism, liberalism, civil society activism and so-called defence of human rights.
Hence this liberal faction clearly gravitates around the west from a geopolitical and idelogical point of view, as opposed to the vintage revolutionary forces. During the 2009 fitna that gave rise to divisive protests, in fact an attempt at "colored revolution" backed by the west following Mahmoud Ahmadinejad's reelection as the president, it was supporters of the reformists and centrists who turned the revolutionary slogan "Down with the USA" upside down and started chanting "Down with Russia, down with China" instead. Clearly it is this liberal camp and not the genuine revolutionary one, which aims at ending any and all resistance against the zio-American world order to which it is willing to submit hands down.
It was the same liberals who, in the framework of the Rohani administration, concluded the JCPoA (nuclear deal) with the US, while Rohani declared on state TV his willingness to reach follow on agreements. These plans for additional deals would have focused on regional policy, by which the west aimed to gradually dismantle Iran's region-wide system of alliances with Palestinian armed resistance groups, with Lebanese Hezbollah, with the Syrian government, with Iraqi PMU forces and with Yemen's Ansarallah movement. And on ballistic missile development, which would have caused Iran to bow to western terms on limiting the range and strength of its missile arsenal and on opening up the whole program for inspection by western agents. Both these potential deals would have deprived Iran of two of its main tools of deterrence against any hypothetical zio-American aggression. It is as if Iranian liberals did not learn any lessons from the Iraqi and Libyan examples which unfolded right before their eyes.
To draw a parallel with China's modern history, Iranian liberals of today are nothing like Zhou En-Lai nor like Deng Xiao-Ping (just as Iran's revolutionaries are nothing like the Gang of Four). Think of Iranian liberals as Gorbachev-cum-Yeltsins.
It should be noted that the liberal faction within the Islamic Republic is almost indistinguishible from the exiled anti-Islamic Republic opposition when it comes to their respective goals. This exiled opposition consists of a host of disparate but meanwhile streamlined elements loyal to the overthrown monarchy and its crown prince Reza Pahlavi, to the MKO terrorist cult, to "ethno"-separatist groupings, to small deviant religious currents (both Shia and wahhabi) plus to assorted, politically insignificant leftist and liberal entities.
Although they want the same thing for Iran, exiled anti-IR opposition on the one hand and domestic in-house liberals within the IR on the other are bitterly competing for the disgraceful position of chief executives of the zio-American scheme. While pragmatic elements among US Democrats and EU regimes by and large believe that Iran's domestic liberals have what it takes to succeed, hawkish forces in the west and in the region (from Netanyahu's Likud to MBZ and MBS, from American lib-hawks to neo-cons and trumpists) doubt the capacity of the domestic fifth-column to get the job done and to outsmart the revolutionary core of the IR, preferring to try and provoke a collapse of the political system through assorted pressure campaigns while touting the exiled opposition as a supposed "alternative".
Now, how is power distributed among Iran's institutions and political factions? To keep it as brief as possible: even while Supreme Leader Khamenei and the IRGC belong to the first camp since they are loyal to khomeinist ideology, and even while the revolutionary camp globally retains the upper hand owing to Iran's cleverly thought out constitutional architecture that makes infiltration and subversion of the system extremely difficult despite the system's partly democratic nature (the other part being theocratic), the same revolutionary forces believe in the educational and practical virtues of pluralism, in the sense that in their view, one cannot simply force the people into the path of righteousness through coercion alone.
In effect the founder of the Islamic Republic, Imam Khomeini, derived his legitimacy essentially from the massive popular support he enjoyed as the leader of the Revolution. However, following decades of nonstop, massive counter-revolutionary propaganda by hostile, foreign-based media on a scale unwitnessed anywhere to this day, some segments of public opinion came under the influence of the zio-American vectors of soft war. The challege therefore consisted, in the eyes of the revolutionary camp, in letting these children of the nation find back to the correct path through experience as a means to heighten their political discernment. The Supreme Leader played it very wisely: knowing the nature of the US regime, he knew fully well that the JCPoA was bound to fail, since the regime in Washington and its lackeys cannot be trusted. He also knew that once the JCPoA fails, the liberal project is bound to lose much of its legitimacy in the eyes of the Iranian population. The inevitable subsequent return to a policy in line with the principles of the Revolution, will thus benefit from enhanced popular support once it comes to pass.
This again is consistent with a school of thought within Shia Islam according to which Mahdi will not manifest until the believers show themselves worthy of his return, through their pious actions, social activism and unshakeable faith.
A second reason why the revolutionary camp, the Supreme Leader and the IRGC did not prevent the Rohani adminstration from attempting the JCPoA experience is because they simply didn't have the required resources in terms of political capital to do so. Notwithstanding the fact that they believe in political pedagogy as described above, even if they didn't, they would not have been able to stop the liberals from trying their luck. For while the revolutionary camp stil retains the upper hand overall, its powers are not dictatorial in nature. The Supreme Leader himself will not refrain from issuing his recommendations and directives, but will then act as an arbiter between factions, not as an autocrat. Therefore the revolutionary camp has to accomodate its liberal rivals up to a certain point. Failing which liberals would seek to destabilize the system from within by calling for mass protests "against dictatorship", something that the daughter of former president and influential leader of the centrist faction, Hashemi Rafsanjani, as well as other liberal figures openly threatened with.
Their alliance with India failed but to even attempt that should be a red flag for China.
As for India, Iran has had no full fledged alliance with New Delhi. Whatever relations Tehran established with India, these aren't directed against China. When it comes to adversity, Iran is focused on the zionist regime, NATO powers and to a lesser extent their regional allies. Apart from the flashpoints involving said hostile entities and Iran's own network of allies, Tehran does not like to take sides in regional conflicts unless they directly affect its vital interests or put its elementary security at stake.
Whenever it senses an opportunity to do so, thanks to its working relationships with both sides of such a conflict, Iran offers its mediation and takes initiatives designed to dampen tensions. This could be seen with Iran's diplomatic efforts in the Nagorno-Karabakh war between Armenia and Azerbaijan in the 1990's, or its hopes that the defunct Iran-Pakistan-India pipeline project would have helped encourage a peaceful resolution of some of the issues pitting Islamabad and New Delhi against each other. The fact that Iran termed the project "Peace Pipeline" is an illustration of its posture.
So there is no reason for Beijing to be any more suspicious about Iran's relations with India than it is vis a vis its Russian partner's far more strategic ties to New Delhi.
USA is stupid to push Iran to China. Iran desired to be USA friend. The sin of Iran is her antagonistic position against Israel, and her determination to be independence.
Iran as a whole did not have such a desire when it comes to the US regime. Only the liberal faction within Iran's political system, represented by the Rohani administration did. That same liberal faction would have no issues abandoning the Palestinians to their fate either.
But the Supreme Leader, genuine revolutionary forces and the IRGC are opposed to this and advocate continued resistance against both regimes of Washington and Tel Aviv.
Iran has lost much time on unrequited love with the west, and spurn China for all those nights, forever waiting for the US to return affection.
Again and again, US return Iran with merciless attack.
True but again, courtesy of the liberal administration of Rohani only. The rest of Iran's establishment never agreed with this policy. It's just that Iran is a religious democracy, and that the liberals have accumulated a certain amount of power - not enough to entirely change the system from within like they dream of, but sufficiently to force the hand of the revolutionaries into letting them at least give it a try with the nuclear deal.
Please read my comprehensive reply to our friend Feng Leng for more details.